﻿using System;
using System.Collections.Generic;

namespace Bricks.Injecting
{

    /// <summary>
    /// 
    /// </summary>
    /// <typeparam name="TService"></typeparam>
    public class MultiValueResolver<TService> : ValueResolverBase<IEnumerable<TService>>
    {

        /// <summary>
        /// 
        /// </summary>
        /// <param name="defaultValueAccessor"></param>
        public MultiValueResolver(Func<IEnumerable<TService>> defaultValueAccessor) :
            base(() => ServiceLocator.Current.ResolveAll<TService>(), defaultValueAccessor)
        {
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="defaultValue"></param>
        public MultiValueResolver(IEnumerable<TService> defaultValue) :
            this(() => defaultValue)
        {
        }

        /// <summary>
        /// 
        /// </summary>
        public MultiValueResolver() :
            this(() => null)
        {
        }
    }
}
